package cn.ycxy.lbl.pojo.order.dto;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;


/**
 * 查询订单列表DTO
 * @author BaoL
 * @since 2023-04-12
 */
@Data
@ApiModel(value="查询订单列表DTO", description="查询订单列表DTO")
public class OrderListDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户id")
    private Long userId;

    @NotNull(message = "订单状态不能为空")
    @ApiModelProperty(value = "状态，-1=全部，0=待发货，1=待收货，2=已完成，3=已取消")
    private Integer state;

    @NotNull(message = "当前页码不能为空")
    @ApiModelProperty(value = "当前页码")
    private Integer pageNo;

    @NotNull(message = "页码大小不能为空")
    @ApiModelProperty(value = "页码大小")
    private Integer pageSize;

    private Integer startIndex;

    public void calculateStartIndex(){
        this.startIndex = (pageNo - 1) * pageSize;
    }

}
